Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize aircrafts actions #1366

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

CrimRecya
Copy link
Contributor

@CrimRecya CrimRecya commented Aug 25, 2024

  • Now, when a stop command (S) is issued to an aircraft, the aircraft will immediately return to the airport. When a guard command (G) is issued, the aircraft will search for targets around the current location and return immediately when target is not found, target is destroyed or ammos are depleted (Note that if the target is destroyed but ammos are not depleted yet, it will also return because the aircraft's command is one-time). When a attack move command (Ctrl+Shift) is issued, the aircraft will move towards the destination and search for nearby targets on the route for attack. Once ammos are depleted or the destination is reached, it will return (Note that if the automatically selected target is destroyed but ammos are not depleted yet during the process, the aircraft will continue to go to the destination).

@Coronia
Copy link
Contributor

Coronia commented Aug 25, 2024

suggest to make these guard behaviors compatible with GuardRange instead of always tying to weapon ranges, just like infantry and units did

@CrimRecya
Copy link
Contributor Author

suggest to make these guard behaviors compatible with GuardRange instead of always tying to weapon ranges, just like infantry and units did

Only the attack move action will use the weapon's range to reduce the range that search the valid target.

Copy link

github-actions bot commented Sep 16, 2024

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

src/Ext/Aircraft/Hooks.cpp Outdated Show resolved Hide resolved
src/Ext/Aircraft/Hooks.cpp Outdated Show resolved Hide resolved
src/Ext/Aircraft/Hooks.cpp Outdated Show resolved Hide resolved
src/Ext/Aircraft/Hooks.cpp Outdated Show resolved Hide resolved
src/Ext/Aircraft/Hooks.cpp Outdated Show resolved Hide resolved
src/Ext/Aircraft/Hooks.cpp Outdated Show resolved Hide resolved
@CrimRecya
Copy link
Contributor Author

TechnoClass
unknown_bool_418 -> bool IsTether
unknown_bool_419 -> bool IsAlternativeTether

FootClass
unknown_5A0 -> AbstractClass* Follow
unknown_int_5C4 -> Mission MegaMission
unknown_5C8 -> AbstractClass* MegaDestination
unknown_5CC -> AbstractClass* MegaTarget
unknown_bool_5D1 -> bool HaveAttackMoveTarget

TechnoClass_vtbl
bool TargetAndEstimateDamage(DWORD dwUnk, DWORD dwUnk2) -> bool TargetAndEstimateDamage(CoordStruct* pSelectCrd, TargetFlags targetFlags)
CellClass* SelectAutoTarget(TargetFlags TargetFlags, int CurrentThreat, bool OnlyTargetHouseEnemy) -> AbstractClass* SelectAutoTarget(TargetFlags targetFlags, CoordStruct* pSelectCrd, bool onlyTargetHouseEnemy)

vt_entry_3B4 -> bool InAuxiliarySearchRange(AbstractClass* pTarget)
vt_entry_3E8 -> int GetSecondaryWeaponIndex()
vt_entry_47C -> void SetFollowTarget(AbstractClass* pFollow)
vt_entry_4A4 -> Mission RespondMegaEventMission(EventClass* pRespondTo)
vt_entry_4A8 -> void ClearMegaMissionData()
vt_entry_4AC -> bool HaveMegaMission()
vt_entry_4B0 -> bool HaveAttackMoveTarget()
vt_entry_4B4 -> Mission GetMegaMission()
vt_entry_4B8 -> CoordStruct* GetAttackMoveCoords(CoordStruct* pBuffer)
vt_entry_4C4 -> bool MegaMissionIsAttackMove()
vt_entry_4C8 -> bool ContinueMegaMission()
vt_entry_4CC -> void UpdateAttackMove()
vt_entry_4D0 -> bool RefreshMegaMission()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants